import styles from './index.module.scss'
type Props = {
  type: '' | 'photo' | 'gender'
  hideList: () => void
  onUpdate: (key: string, value: string) => void
}
const EditList = (props: Props) => {
  const { hideList, type, onUpdate } = props
  return (
    <div className={styles.root}>
      {type === 'gender' ? (
        <>
          <div className="list-item" onClick={() => onUpdate('gender', '0')}>
            男
          </div>
          <div className="list-item" onClick={() => onUpdate('gender', '1')}>
            女
          </div>
        </>
      ) : (
        <>
          <div className="list-item">拍照</div>
          <div className="list-item" onClick={() => onUpdate('photo', '')}>
            本地选择
          </div>
        </>
      )}

      <div className="list-item" onClick={hideList}>
        取消
      </div>
    </div>
  )
}

export default EditList
